package ooday02;

public class OverrideDemo {
    public static void main(String[] args) {
        Student zg=new Student("张光",25,"北京","计算机","20201209623");
        zg.sayHi();//调用Student类重写后的sayHi

        Teacher ll=new Teacher("李林",45,"北京",6000.0);
        ll.sayHi();//调用Teacher类重写后的sayHi
        Doctor zl=new Doctor("赵林",45,"北京","主任医师");
        zl.sayHi();//调用Person类的sayHi    //  Doctor类没有重写sayHi方法
    }
}
